package com.ly.demo08.controller;

import com.ly.demo08.common.Result;
import com.ly.demo08.entity.UserInfo;
import com.ly.demo08.service.UserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
@CrossOrigin("*")
@RestController
public class UserInfoController {
    @Autowired
    private UserInfoService userInfoService;
    @GetMapping("/api/users")
    public Result list() {
        List<UserInfo> list = userInfoService.list();
        return Result.success(list);
    }
}
